<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #3f3f3f; background-color: #f1f1f1;">
<body>
<style type="text/css">
  a, a:visited {
    color: #6bb5df !important;
  }

  a:hover {
    color: #CCCCCC !important;
  }
</style>
<div style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #3f3f3f; background-color: #f1f1f1;">
  <table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable" bgcolor="#f1f1f1">
    <tr>
      <td align="center" valign="top">
        <table border="0" id="emailContainer" style="max-width: 600px;">
          <tr>
            <td align="center" valign="top">
              <div align="left">
                <h2 style="font-weight: normal;"><%= _("<b>PROMOTION</b> SUMMARY").html_safe %></h2>

                <%= (_("The promotion of %{content_view} to <b>%{environment}</b> has completed.  %{count} needed errata are installable on your hosts.") %
                     {:content_view         => link_to(@content_view.name, content_view_path(@content_view)),
                      :environment          =>  @environment.name,
                      :count                => link_to(@errata.count, content_view_environment_errata_path(@content_view, @environment))}).html_safe %></p>
              </div>
              <table border="0" width="100%" id="emailHeader" style="background-color: #e1e2e3;" bgcolor="#e1e2e3">
                <tr>
                  <td align="left" valign="top" style="padding: 0px 20px;">
                      <%= render :partial => 'host_dashboard', :locals => {:hosts => @hosts, :title => _("Hosts with Installable Errata")} %>

                      <% if @errata.count > 100 %>
                        <%= _("A large number of errata are unapplied in this content view, so only the first 100 are shown.") %>
                      <% end -%></p>

                      <% @errata = @errata.take(100).group_by(&:errata_type) %>

                  </td>
                </tr>
              </table>
            </td>
          </tr>
          <tr>
            <td align="center" valign="top">
              <table border="0" width="100%" id="emailBody" style="background-color: #fff; margin-top: 10px; padding: 0px 0px 15px;" bgcolor="#fff">
                <tr>
                  <td align="left" valign="top" style="padding: 0px 20px 5px;">
                    <h2 style="font-weight: normal;"><%= _("Unapplied Errata") %></h2>

                    <% if @errata.blank? %>
                      <%= _("None") %>
                    <% else %>
                      <div align="center">
                        <% ['security', 'bugfix', 'enhancement'].each do |errata_type| %>
                          <% next if @errata[errata_type].nil? %>
                          <h3 style="text-align: left; margin: 10px 0px 5px;" align="left"><%= _("%s Errata") % errata_type.titleize %></h3>
                          <%= render :partial => 'erratum', :collection =>  @errata[errata_type], :as => :erratum %>
                        <% end -%>
                      </div>
                    <% end -%>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
          <tr>
            <td align="center" valign="top">
              <table border="0" cellpadding="20" cellspacing="0" width="100%" id="emailFooter" style="background-color: #e1e2e3;" bgcolor="#e1e2e3">
                <tr>
                  <td align="left" valign="top" style="font-size: 82%; padding: 0px 20px;">

                  </td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
</div>
</body>
</html>
